#ifndef MAIN_WINDOW_H_H_H_H_
#define MAIN_WINDOW_H_H_H_H_
#ifndef Q_MOC_RUN
#include <boost/signal.hpp>
#endif

#include <QMainWindow>
#include <QMdiArea>
#include <QLabel>
class ViewWindow;
class MainWindow :	public QMainWindow
{
	Q_OBJECT
public:
	MainWindow(QWidget * parent = 0, Qt::WFlags f = Qt::Window);
	~MainWindow(void);
public:

     void loadWindowSettings();

	 ViewWindow* activeWindow()const;

	 void addWindow(ViewWindow* view);
	 void removeWindow(ViewWindow* view);
	 void setActiveWindow(ViewWindow* view);




	 void keyPressEvent(QKeyEvent *e);

public Q_SLOTS:
	 void onWindowDestroyed();
	 void showMessage (const QString & message, int timeout = 0);

private Q_SLOTS:

	void updateActions();

	void showMainWindow();

	void onWindowActivated(QWidget*);




Q_SIGNALS:

	 void windowStateChanged(ViewWindow*);
	 void mainWindowClosed();


public:
	static MainWindow* getInstance();
	static MainWindow* _instance;

	void closeEvent (QCloseEvent * e);
	bool eventFilter(QObject *, QEvent *);

private:

	  QLabel*  actionLabel,*sizeLabel;
	  struct MainWindowP* d;
};

inline MainWindow* getMainWindow()
{
	return MainWindow::getInstance();
}
#endif